function getURLparams(URL) {
  let obj = {};
  let str = URL.split("?")[1].split("&");
  console.log(str);
  str.forEach((elem) => {
    let temp = elem.split("=");
    obj[temp[0]] = temp[1];
  });
  return obj;
}

let URL = 'https//www.baidu.com?username="tom"&password="123"';
getURLparams(URL);
